#include "jrtplib3/rtpconfig.h"
#include "jrtplib3/rtpsocketutil.h"
#include "jrtplib3/rtpsession.h"
#include "jrtplib3/rtpsessionparams.h"
#include "jrtplib3/rtperrors.h"
#include "jrtplib3/rtpsourcedata.h"
#include "jrtplib3/rtptcpaddress.h"
#include "jrtplib3/rtptcptransmitter.h"
#include "jrtplib3/rtppacket.h"
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <vector>

using namespace std;

class MyTCPTransmitter : public RTPTCPTransmitter
{
public:
    MyTCPTransmitter(const string &name) : RTPTCPTransmitter(0), m_name(name) {}

    void OnSendError(SocketType sock)
    {
        cout << m_name << ": Error sending over socket " << sock << ", removing destination" << endl;
        DeleteDestination(RTPTCPAddress(sock));
    }

    void OnReceiveError(SocketType sock)
    {
        cout << m_name << ": Error receiving from socket " << sock << ", removing destination" << endl;
        DeleteDestination(RTPTCPAddress(sock));
    }

private:
    string m_name;
};